import 'katex/dist/katex.min.css';
import { ContentBlock } from "draft-js"
import TeX from '@matejmazur/react-katex';


interface Props {
    block: ContentBlock
}

const LaTexBlock = (props: Props) => {

    const {
        block
    } = props;

    const blockText = block.getText();
    
    return (
        <div style={{width: '100%', textAlign: 'center', marginTop: '12pt', marginBottom: '12pt'}}>
            <TeX
                math={blockText}
            />
        </div>
    )
}

export default LaTexBlock